package cc.rengu.igas.bsps.core.service.trans;

import cc.rengu.igas.bsps.core.service.base.ManageService;
import cc.rengu.igas.bsps.facade.request.CustomerStatisticRequest;
import cc.rengu.igas.bsps.facade.response.AcctIssuerQueryResponse;
import cc.rengu.igas.bsps.facade.response.CustomerStatisticResponse;
import cc.rengu.oltp.service.model.BizResponse;
import cc.rengu.oltp.utility.util.ConvertUtil;

public class CustomerStatisticService extends ManageService {
    @Override
    protected Object bizBeforeCust() throws Exception {
        CustomerStatisticRequest request=new CustomerStatisticRequest();
        ConvertUtil.convertOutput(request);
        return request;
    }

    @Override
    protected BizResponse bizProcessCust(Object request) throws Exception {
//        1.判断统计类型，若为日，根据商户号、机构标识、统计维度、统计日期查询顾客统计分析结果表数据，汇总数据：
//根据统计维度为小时查询出数据后计算统计出新、老顾客数量及人数占比、人数汇总，及新、老顾客当日总交易金额及交易笔数；
//拆分数据：
//统计当天每个小时的新、老顾客人数，新、老顾客交易金额及交易笔数

        return null;
    }

    @Override
    protected void bizAfterCust(Object response) throws Exception {
        BizResponse bizResponse = (BizResponse) response;
        CustomerStatisticResponse customerStatisticResponse = (CustomerStatisticResponse) bizResponse.getResult();
        ConvertUtil.convertInput(customerStatisticResponse);
    }
}
